package com.example.barcodeapp.persenter.own;

import com.example.barcodeapp.base.BasePersenter;
import com.example.barcodeapp.bean.YanZhengMaBean;
import com.example.barcodeapp.bean.ownbean.XiLieKeBean;
import com.example.barcodeapp.common.CommonSubscriber;
import com.example.barcodeapp.interfaces.own.IOwn;
import com.example.barcodeapp.model.HttpManager;
import com.example.barcodeapp.ui.own.bean.KeChengBean;
import com.example.barcodeapp.utils.RxUtils;

public class OnePresenter extends BasePersenter<IOwn.View2> implements IOwn.Persenter2 {


    @Override
    public void getXiLieKe2(int l_id, int lc_id, int cc_id, int page, int search, int uid) {
        addSubscribe(HttpManager.getInstance().getOwnTpApi().getWindow(l_id,lc_id,cc_id,page,search,uid)
                .compose(RxUtils.rxScheduler())
                .subscribeWith(new CommonSubscriber<KeChengBean>(mView) {
                    @Override
                    public void onNext(KeChengBean hanFuDaBean) {
                        mView.getXiLieKe2(hanFuDaBean);
                    }
                }));
    }

    @Override
    public void getXiLieKe2(int l_id, int lc_id, int page) {
        addSubscribe(HttpManager.getInstance().getOwnTpApi().getWindow(l_id,lc_id,page)
                .compose(RxUtils.rxScheduler())
                .subscribeWith(new CommonSubscriber<KeChengBean>(mView) {
                    @Override
                    public void onNext(KeChengBean hanFuDaBean) {
                        mView.getXiLieKe2(hanFuDaBean);
                    }
                }));
    }
}
